home *** CD-ROM | disk | FTP | other *** search
/ PCNet 2004 October / PCNET_CD_2004_10_1.iso / shareware / pspad431inst_en.exe / {app} / Context / Java.DEF < prev    next >
Encoding:
Text File  |  2003-08-30  |  1.5 KB  |  62 lines

  1. ; PSPad clip definition file for Java
  2. ; Created by PSPad   14.7.2002
  3. ; Author:  Jan Fiala  pspad@wo.cz
  4. ;
  5. [prog | Java program - base]
  6. public class |MyProg {
  7.     /** code description */
  8.     public static void main(String[] args) {
  9.         /* multiline comments */
  10.         // single line comments
  11.         System.out.println("Hello, world");
  12.     }
  13. }
  14. ;
  15. [servlet | Java Servlet - base]
  16. import java.io.*;
  17. import javax.servlet.*;
  18. import javax.servlet.http.*;
  19.  
  20. public class |MyServlet extends HttpServlet {
  21.     PrintWriter out;
  22.  
  23.     public void doGet(HttpServletRequest req, HttpServletResponse res) {
  24.         try {
  25.             res.setContentType("text/html");
  26.             out = res.getWriter();
  27.             String html = "<html>Hello, world</html>";
  28.             out.println(html);
  29.         }
  30.         catch (Exception e) { e.printStackTrace(); }
  31.     }
  32.  
  33.     public void doPost(HttpServletRequest req, HttpServletResponse res) {
  34.         try {
  35.             res.setContentType("text/html");
  36.             out = res.getWriter();
  37.             String html = "<html>Hello, world</html>";
  38.             out.println(html);
  39.         }
  40.         catch (Exception e) { e.printStackTrace(); }
  41.     }
  42. }
  43. ;
  44. [for | for cycle]
  45. for (int i=0; i<|; i++) {}
  46. ;
  47. [try | try-catch block]
  48. try {
  49.     |
  50. }
  51. catch (Exception e) {
  52.     System.out.println("Unexpected exception");
  53.     e.printStackTrace();
  54. }
  55. finally {}
  56. ;
  57. [while | while cycle]
  58. int i=0;
  59. while (i < |) {
  60.  
  61.     i++;
  62. }